Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] Extract apiDoc params from the schema definitions #62933

Merged
merged 31 commits into from
Apr 15, 2020

Conversation

darnautov
Copy link
Contributor

@darnautov darnautov commented Apr 8, 2020

Summary

Extracts apiDoc parameters from the schema definition with the custom worker. Please check x-pack/plugins/ml/server/routes/README.md for instructions to generate the documentation locally.

image

@darnautov darnautov added :ml v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.8.0 labels Apr 8, 2020
@darnautov darnautov self-assigned this Apr 8, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@peteharverson
Copy link
Contributor

You can end up with duplicated parameters sections, where they are defined with @apiParam in the route and in the schema. Also some of the formatting in the cells looks a bit odd (### Parameters and :---------)

@apiParam
image

@peteharverson
Copy link
Contributor

Is there a way of removing the duplicate 'Parameters' label?

image

@peteharverson
Copy link
Contributor

For the Instantiate an anomaly detection job route, should the analysis_config parameter have a separate entry in the table, like say datafeed_config has:

image

@darnautov darnautov marked this pull request as ready for review April 10, 2020 16:33
@darnautov darnautov requested a review from a team as a code owner April 10, 2020 16:33
@@ -315,8 +310,6 @@ export function jobRoutes({ router, mlLicense }: RouteInitialization) {
* @api {post} /api/ml/anomaly_detectors/_validate/detector Validate detector
* @apiName ValidateAnomalyDetector
* @apiDescription Validates specified detector.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs an @apiSchema param.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed, but it has not been described yet (schema.any())

x-pack/plugins/ml/server/routes/indices.ts Show resolved Hide resolved
x-pack/plugins/ml/server/routes/job_service.ts Outdated Show resolved Hide resolved
@darnautov darnautov requested a review from peteharverson April 14, 2020 16:33
@alvarezmelissa87
Copy link
Contributor

How should the version be specified? All the versions are at 0.0 right now.
image

Copy link
Contributor

@alvarezmelissa87 alvarezmelissa87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gave this a test and LGTM ⚡ Just left a small question.

@darnautov
Copy link
Contributor Author

@elasticmachine merge upstream

@walterra
Copy link
Contributor

It looks like even if we only have a package.json in the ML plugin folder, this updates the overall yarn.lock file in Kibana's root. I wonder if we have an audit process in place for adding a lot of new dependencies like this? (I didn't spot yarn.lock being part of CODEOWNERS maybe that's something worth doing so changing dependencies gives people involved more visibility? Not something for this PR but more of a general suggestion/question)

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested latest edits and LGTM. Please double check that the KIbana platform / operations are happy with our dedicated package.json before merging.

@darnautov darnautov requested a review from a team as a code owner April 15, 2020 11:45
Copy link
Member

@mistic mistic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes on the files under operations team code owners LGTM

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@darnautov darnautov merged commit 7058070 into elastic:master Apr 15, 2020
wayneseymour pushed a commit that referenced this pull request Apr 15, 2020
* [ML] WIP apiDoc schema extractor

* [ML] extract actual type

* [ML] refactor schema definitions

* [ML] Update README.md

* [ML] extract nested

* [ML] call job validation endpoint with complete payload

* [ML] escape special chars and fix line breaks

* [ML] clean up extractDocEntries

* [ML] serializeWithType

* [ML] add missing annotations

* [ML] fix parent schema assigment

* [ML] support object composition

* [ML] support multiple schemas per block

* [ML] fix for collections

* [ML] fix calendarIdsSchema

* [ML] add ml package.json with apidoc commands

* [ML] use the single output markdown file

* [ML] fix typo

* [ML] change the Calendars order

* [ML] adjust the order in adidoc.json

* [ML] update api version

* [ML] update tsconfig.json include

* [ML] update packages/kbn-pm/dist/index.js

* [ML] update ML overrides in .eslintrc.js

* [ML] yarn.lock symlink

* Revert "[ML] yarn.lock symlink"

This reverts commit 07f0680

Co-authored-by: Elastic Machine <[email protected]>
@darnautov darnautov deleted the ML-apiDoc-gen branch April 16, 2020 07:17
darnautov added a commit to darnautov/kibana that referenced this pull request Apr 16, 2020
* [ML] WIP apiDoc schema extractor

* [ML] extract actual type

* [ML] refactor schema definitions

* [ML] Update README.md

* [ML] extract nested

* [ML] call job validation endpoint with complete payload

* [ML] escape special chars and fix line breaks

* [ML] clean up extractDocEntries

* [ML] serializeWithType

* [ML] add missing annotations

* [ML] fix parent schema assigment

* [ML] support object composition

* [ML] support multiple schemas per block

* [ML] fix for collections

* [ML] fix calendarIdsSchema

* [ML] add ml package.json with apidoc commands

* [ML] use the single output markdown file

* [ML] fix typo

* [ML] change the Calendars order

* [ML] adjust the order in adidoc.json

* [ML] update api version

* [ML] update tsconfig.json include

* [ML] update packages/kbn-pm/dist/index.js

* [ML] update ML overrides in .eslintrc.js

* [ML] yarn.lock symlink

* Revert "[ML] yarn.lock symlink"

This reverts commit 07f0680

Co-authored-by: Elastic Machine <[email protected]>
darnautov added a commit that referenced this pull request Apr 16, 2020
…#63663)

* [ML] Extract apiDoc params from the schema definitions (#62933)

* [ML] WIP apiDoc schema extractor

* [ML] extract actual type

* [ML] refactor schema definitions

* [ML] Update README.md

* [ML] extract nested

* [ML] call job validation endpoint with complete payload

* [ML] escape special chars and fix line breaks

* [ML] clean up extractDocEntries

* [ML] serializeWithType

* [ML] add missing annotations

* [ML] fix parent schema assigment

* [ML] support object composition

* [ML] support multiple schemas per block

* [ML] fix for collections

* [ML] fix calendarIdsSchema

* [ML] add ml package.json with apidoc commands

* [ML] use the single output markdown file

* [ML] fix typo

* [ML] change the Calendars order

* [ML] adjust the order in adidoc.json

* [ML] update api version

* [ML] update tsconfig.json include

* [ML] update packages/kbn-pm/dist/index.js

* [ML] update ML overrides in .eslintrc.js

* [ML] yarn.lock symlink

* Revert "[ML] yarn.lock symlink"

This reverts commit 07f0680

Co-authored-by: Elastic Machine <[email protected]>

* update packages/kbn-pm/dist/index.js

Co-authored-by: Elastic Machine <[email protected]>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Apr 17, 2020
* master: (56 commits)
  [i18n] Update CODEOWNERS (elastic#63354)
  add platform team definition of done (elastic#59993)
  [SIEM] move away from Joi for importing/exporting timeline (elastic#62125)
  Fix discover preserve url (elastic#63580)
  [alerting] Adds an alertServices mock and uses it in siem, monitoring and uptime (elastic#63489)
  Closes elastic#63109 for Service Map by resetting edges styles for the selected node (elastic#63655)
  MIgrated index_header to react (elastic#63490)
  Index pattern management UI -> TypeScript and New Platform Ready (indexed_fields_table) (elastic#63364)
  [SIEM] [Cases] Insert timeline and reporters/tags in table bug fixes (elastic#63642)
  [Reporting] Make usable default element positions (elastic#63191)
  [Reporting] Switch Serverside Config Wrapper to NP (elastic#62500)
  [Reporting] Add "warning" status as an alternate type of completed job (elastic#63498)
  Split action types into own page (elastic#63516)
  [Lens] Only show copy on save for previously saved docs (elastic#63535)
  Update README.md (elastic#63622)
  Bugfix clear saved query crashes kibana on Discover in some cases (elastic#63554)
  Add uptime CODEOWNER entries. (elastic#63616)
  [ML] Extract apiDoc params from the schema definitions (elastic#62933)
  Fix alerting documentation encryption key requirement (elastic#63512)
  Fix CODEOWNERS and sass lint paths (elastic#63552)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:ml release_note:skip Skip the PR/issue when compiling release notes v7.8.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants